// MainDlg.h : interface of the CMainDlg class
//
/////////////////////////////////////////////////////////////////////////////

#pragma once

#include "skin/SkinLib.h"
#include "BuddyListCtrl.h"

class CMainDlg : public CDialogImpl<CMainDlg>, public CUpdateUI<CMainDlg>,
		public CMessageFilter, public CIdleHandler
{
public:
	enum { IDD = IDD_MAINDLG };

	virtual BOOL PreTranslateMessage(MSG* pMsg);
	virtual BOOL OnIdle();

	BEGIN_UPDATE_UI_MAP(CMainDlg)
	END_UPDATE_UI_MAP()

	BEGIN_MSG_MAP_EX(CMainDlg)
		MSG_WM_INITDIALOG(OnInitDialog)
		MSG_WM_CLOSE(OnClose)
		MSG_WM_DESTROY(OnDestroy)
		REFLECT_NOTIFICATIONS()
	END_MSG_MAP()
	
private:
	BOOL OnInitDialog(CWindow wndFocus, LPARAM lInitParam);
	void OnClose();
	void OnDestroy();
	
	void CloseDialog(int nVal);
	void InitUI();
	
	BOOL InitItemListCtrl(HDC hDlgBgDC);
	BOOL InitServerListCtrl(HDC hDlgBgDC);
	BOOL InitPlayerListCtrl(HDC hDlgBgDC);

	void UpdateListCtrl();
	void UpdateSvrListCtrl();
	void UpdatePlrListCtrl();

private:
	CSkinDialog m_SkinDlg;
	CSkinButton m_HomeBtn;
	CSkinButton m_StoreBtn;
	CSkinButton m_RankBtn;
	CSkinButton m_SettingsBtn;
	CSkinPictureBox m_LogoPic;

	CBuddyListCtrl m_ItemListCtrl;
	CSkinListCtrl m_ServerListCtrl;
	CSkinListCtrl m_PlayerListCtrl;
};
